<?php
session_start();
if(!$_SESSION['id'])
	exit;
include '../class/connect.inc.php';
switch($_POST['action']){
case 'delete':
	$re=$mysqli->query('select user_id from blog where id='.$_POST['aid']);
	$row=$re->fetch_assoc();
	if(($_SESSION['authority']!=1)&&($_SESSION['id']!=$row['user_id']))
		return false;
	header('content-type:text/html;charset=utf-8');
	include '../class/article.class.php';
	$art=new Article();
	$bool=$art->deleteBlog($_POST['aid']);
	echo $bool;
	break;
case 'change':
	$sql='update blog set publish_time='.time().',check_status="'.$_POST['pro'].'" where id='.$_POST['aid'];
	$mysqli->query($sql);
	$mysqli->close();
	break;
}
